package com.atiguigu.mybatisplus.minio;

import io.minio.BucketArgs;
import io.minio.BucketExistsArgs;
import io.minio.MinioClient;
import io.minio.UploadObjectArgs;
import lombok.SneakyThrows;

public class M1{
    @SneakyThrows
    public static void main(String[] args) {
//        String time = new DataTime().toString();

        MinioClient minioClient=MinioClient.builder()
                .endpoint("http://192.168.6.100:9000")
                .credentials("minioadmin","minioadmin")
                .build();
    BucketExistsArgs bucketExistsArgs= BucketExistsArgs.builder().bucket("test1").build();
        boolean b = minioClient.bucketExists(bucketExistsArgs);
        System.out.println(b);


        minioClient.uploadObject(UploadObjectArgs.builder().object("超级大哥大.gif")
                .bucket("test1")
                .filename("D:\\帅气男人\\图片\\41e4782cb9f24b69a66e0e1deef19e68.gif")
                .build());

    }
;

}
